let upTimer = null;
$('#uptest').click(function(){
	console.log(upTimer)
	$('.upload_popup').fadeIn();
	upTimer = setTimeout(()=>{
		$('.upload_popup').fadeOut();
		upTimer = null;
	},1000)
})
$('.upload_popup').click(function(){
	if(upTimer){
		clearTimeout(upTimer);
		$('.upload_popup').fadeOut();
	}
})
$('.up_input_class').click(function(){
	$('.up_one').toggle()
})
$('.up_one>li').click(function(){
	$('.up_two').css('display','none')
	$(this).children('.up_two').css('display','block');
	event.stopPropagation();
})
$('.up_two>li').click(function(){
	$('.selectUpClass').text($(this).text());
	$('.up_one').css('display','none')
	$('.up_two').css('display','none')
	event.stopPropagation();
})
$('#clickUp').click(function(){
	$('#up_file').click()
})
$('#up_file').change(function(){
	$('#file_name').text(this.files[0].name)
	let reader = new FileReader();
	reader.readAsText(this.files[0])
	reader.onload = function(e){
		console.log(e.target.result)
		editor.txt.html(e.target.result)
	}
	// var file = this.files[0];
	// var fr = new FileReader();
	// fr.readAsDataURL(file);
	// fr.onload = function(){
	// 	console.log(fr.result)
		
	// }
})